#pragma once

#include <io/rttIODevice.h>

namespace NXMFC
{

class dshot: private NXMFC::rttIODevice
{
public:
enum dshot_type
{
    DSHOT1200 = 1200000,
};

public:
    dshot();
    ~dshot();

    bool init(const char *dev, enum dshot_type type = DSHOT1200, int channels_need = 4);
    int output(unsigned short value[4]);

private:
    unsigned short add_checksum(unsigned short value);

private:
    unsigned short *buf;
};

}
